package com.fadadianqi.logistics.inventory.dao;

import com.fadadianqi.commons.BaseDAO;
import com.fadadianqi.logistics.inventory.model.Item;
import com.yeqiangwei.commons.util.Pagination;

import java.util.List;

public interface ItemDAO extends BaseDAO<Item> {

    int countNormalStatusByGoodsId(String goodsId);

    Item getNormalByGoodsId(String goodsId);

    List<Item> findByBatchId(String batchId);

    Item getNormalItemByBatchId(String batchId);

    int countNormalStatusByBatchId(String batchId);

    Double sumCost();

    int countByBrandIdAndCategoryId(String brandId, String categoryId,
                                    int status);

    List<Item> findLeCost(Double maxCost);

    Double sumPurchase();

    Double sumPurchaseByBrandIdAndCategoryId(String brandId, String categoryId,
                                             int status);

    Double sumCostByBrandIdAndCategoryId(String brandId, String categoryId,
                                         int status);

    int countByGoodsIdAndStorehouseIdAndStatus(String goodsId, String storehouseId, int status);

    void dispatchStorehouse(String goodsId, String fromId, String storehouseId);

    List<Item> findByGoodsIdAndStorehouseIdAndStatus(String goodsId, String storehouseId,
                                                     int status, Pagination pagination);

    Item getNormalItemByGoodsIdAndStorehouseId(String goodsId,
                                               String storehouseId);

}
